<html>
<head>
  <title>Google</title>
  <!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->
  <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAveCD76jBlIVnkXx3FF4c5hQh_EXt2nVYv1GZRdRodwSWvcsrdRTOeT7TXlM37PZYDDuRdE44QhDf9A"></script>
  <script type="text/javascript">
google.load("earth", "1");
google.load("maps", "2.99");  // For JS geocoder

var ge = null;
var geocoder;


function init() {
  geocoder = new GClientGeocoder();
  google.earth.createInstance("map3d", initCB, failureCB);
}

function initCB(object) {
  ge = object;
  ge.getWindow().setVisibility(true);
}

function failureCB(object) {
  alert('load failed');
}

function submitLocation() {
  var address = document.getElementById('address').value;
  geocoder.getLatLng(
    address, 
    function(point) {
      if (point && ge != null) {
        var la = ge.createLookAt('');     
        la.set(point.y, point.x, 100, ge.ALTITUDE_RELATIVE_TO_GROUND, 
               0, 0, 4000);
        ge.getView().setAbstractView(la);
      }
    }
  );
}

function show_pic()
{
	var groundOverlay = ge.createGroundOverlay('');
groundOverlay.setIcon(ge.createIcon(''))
groundOverlay.getIcon().
  setHref("http://www.google.com/intl/en_ALL/images/logo.gif");
groundOverlay.setLatLonBox(ge.createLatLonBox(''));

var center = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
var north = center.getLatitude() + .85;
var south = center.getLatitude() - .85;
var east = center.getLongitude() + .55;
var west = center.getLongitude() - .55;
var rotation = 0;
var latLonBox = groundOverlay.getLatLonBox();
latLonBox.setBox(north, south, east, west, rotation);

ge.getFeatures().appendChild(groundOverlay);
}
  </script>
  
</head>
<body onload='init()' id='body'>
  <div>
    <form name='searchform' id='searchform' action='javascript:submitLocation();void(0);'>
      <input type=text size=60 id='address'></input>
      <input type=submit value='Go to location'>
	  <input type="button" value="show PIC" onClick="show_pic()">
    </form>
  </div>

  <div id='map3d_container' style='border: 1px solid silver; height: 500px;'>

    <div id='map3d' style='height: 100%;'></div>
  </div>
</body>
</html>